<template>
	<view class="shop">
		<view class="shop-dt">
			<image :src="dt" mode="aspectFill" class="pic_img" />
		</view>
		<view class="shop-t n-pag">
			<view class="shop-tit">
				{{title}}
			</view>
			<view class="shop-info">
				生产工艺和品质可以满足无铅、无鏀、ROHS标准。
			</view>
			<view class="shop-more flex_box">
				<view class="flex">
					<button open-type="contact" class="shop-more-a">
						<text class="iconfont icon-zixun"></text>
						<text class="shop-more-tit">在线咨询</text>
					</button>
				</view>
				<view class="flex">
					<view class="shop-more-a" @tap="golink" :data-urls="'/pages/product2/product2?typeid=' + typeid">
						<text class="iconfont icon-liebiao"></text>
						<text class="shop-more-tit">返回列表</text>
					</view>
				</view>
				<view class="flex">
					<button open-type="share" class="shop-more-a">
						<text class="iconfont icon-fenxiang"></text>
						<text class="shop-more-tit">分享好友</text>
					</button>
				</view>
			</view>
		</view>

		<view class="shop-br"></view>
		<view class="shop-item">
			<view class="shop-type">
				<text><text class="left_hr"></text>生产能力 <text class="right_hr"></text></text>
			</view>
			<view class="shop-body">
				公司目前的生产设备和能力：拥有全新进口雅马哈与JUKI贴片机和多功能贴片机多台和GkG/G5全新自动锡膏印刷机全新SPI等锡膏检查设备。全新的神州AOI/ALD515外观检测机。全新的SMT首件测试仪及全新劲拓10温区回流焊及全新劲拓重型爪波峰焊。
				生产能力：01005、0201、0402、0603、0805、1206、0.4mm间距的BGA。生产工艺和品质可以满足无铅、无鏀、ROHS标准。并且公司有从事PCB焊接十几年经验的高级工程师为您的产品质量保驾护航让您省心省力。
			</view>
		</view>
		<view class="shop-br"></view>
		<view class="shop-item">
			<view class="shop-type">
				<text><text class="left_hr"></text>生产车间<text class="right_hr"></text></text>
			</view>
			<view class="shop-body">
				<swipers></swipers>
			</view>
		</view>
		<view class="shop-br"></view>
		<view class="shop-item">
			<view class="shop-type">
				<text><text class="left_hr"></text>详细介绍 <text class="right_hr"></text></text>
			</view>
			<view class="shop-body">
				<view>
					<rich-text type="text" :nodes="body"></rich-text>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	import graceRichText from '../../utils/richText.js'

	import {
		ajaxview,
	} from '../../utils/api.js'
	export default {
		data() {
			return {
				aid: '',
				channlid: '',
				body: '',
				dt: '',
				title: '',
				typename: '',

			}
		},
		onShareAppMessage(res) {
			console.log(res)
			return {
				title: this.title,
				imageUrl: this.dt
			}
		},
		onLoad(options) {
			var that = this
			console.log(options)
			that.aid = options.aid
			that.channlid = options.channlid
			that.typename = options.typename
			that.loadart()
		},
		methods: {
			loadart: function() {
				let that = this
				ajaxview(that.aid, that.channlid).then(res => {
					console.log(res)
					if (res.data.data) {
						that.body = graceRichText.format(res.data.data.body)
						that.dt = res.data.data.cfg_basehost + res.data.data.litpic
						that.title = res.data.data.title
						uni.setNavigationBarTitle({
						    title: res.data.data.title
						});
					}
				})
			},
			golink: function(e) {
				console.log(e.currentTarget.dataset)
				let {
					urls
				} = e.currentTarget.dataset
				uni.navigateTo({
					url: urls,
				})
			},
			
		}
	}
</script>

<style lang="scss">
	.shop {
		background-color: #fff;
	}

	.shop-br {
		background-color: #f3f3f3;
		padding: 1vw 2vw;
		width: 100%;
	}

	.shop-dt {
		width: 100%;

		.pic_img {
			width: 100%;
		}
	}

	.shop-t {
		.shop-tit {
			font-size: 4vw;
			font-weight: bold;
		}

		.shop-info {
			margin-top: 2vw;
			font-size: 3.2vw;
		}
	}

	.n-pag {
		padding: 3vw 4vw;
	}

	.shop-more {
		margin-top: 4vw;
		text-align: center;

		.shop-more-a {
			background-color: #f7f6fb;
			display: inline-block;
			padding: 1.2vw 5vw;
			border-radius: 50vw;
			line-height: 1.2;
			border: none;
			background-color:#transparent !important;
			&:after{
				border: none;
			}
			
			color: #888;

			.iconfont {
				font-size: 4vw;
				margin-right: 1vw;
				display: inline-block;
				vertical-align: middle;
			}

			.shop-more-tit {
				font-size: 3vw;
			}
		}
	}

	.shop-item {}

	.shop-type {
		padding: 3vw;
		text-align: center;
		color: $base;
		font-weight: 700;
		font-size: 3.6vw;
    
		text {
			position: relative;
		}

		.right_hr {
			left: 110%;
			background: linear-gradient(to left, rgba(0, 37, 106, 0), rgba(0, 37, 106, 1));
		}

		.left_hr,
		.right_hr {
			width: 5vw;
			margin-top: -0.3vw;
			height: 0.6vw;
			position: absolute;
			top: 50%;
		}

		.left_hr {
			right: 110%;
			background: linear-gradient(to right, rgba(0, 37, 106, 0), rgba(0, 37, 106, 1));
		}
	}

	.shop-body {
		padding: 0 3vw 2vw;
		font-size: 3.5vw;
		line-height: 1.8;
	}
</style>
